function init(){
	var map = L.map("map").setView([30.56486,114.353622 ], 8);
	L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
		attribution: 'Map data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
		maxZoom: 18,
		id: 'mapbox/streets-v11',
		tileSize: 512,
		zoomOffset: -1,
		accessToken: 'pk.eyJ1IjoibGl6eWFncnMiLCJhIjoiY2t1M2UxNmd1NGV4ZDJwbzIzYWxoOGZlbiJ9.PYUoUFa8Twrx8GNhUq8Ydg'
	}).addTo(map);
	
	var mbUrl = 'https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw';
	var mbAttr = 'Map data &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>';
	
	var grayscale = L.tileLayer(mbUrl, {id: 'mapbox/light-v9', tileSize: 512, zoomOffset: -1, attribution: mbAttr});
	var streets = L.tileLayer(mbUrl, {id: 'mapbox/streets-v11', tileSize: 512, zoomOffset: -1, attribution: mbAttr});
	var satellite = L.tileLayer(mbUrl, {id: 'mapbox/satellite-v9', tileSize: 512, zoomOffset: -1, attribution: mbAttr});
	
	var baseLayers = {
		'Sputnik': L.tileLayer('http://{s}.tiles.maps.sputnik.ru/{z}/{x}/{y}.png', {
			maxZoom: 18,
			attribution:"Sputnik Layer"
		}),
	 
		"CartoDB Positron": L.tileLayer('http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
			maxZoom: 18
		}),
	 
		"OSM": L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
			maxZoom: 18
		}),
	 
		"OpenTopoMap": L.tileLayer('https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png', {
			maxZoom: 18
		}),
	};
	 
	
	// 遍历每个要素的指定字段
	function onEachFeature(feature, layer) {
	    // does this feature have a property named popupContent?
	    if (feature.properties && feature.properties.name) {
	        layer.bindPopup(feature.properties.name);
	    }
	}
	
	var Pro_Style = {
	    "color": "#00aa00",
	    "weight": 2,
	    "opacity": 0.5
	};
	
	// 湖北省geojson
	var hubeiprovince_geojson = L.geoJSON(null,{style:Pro_Style,
											    onEachFeature: onEachFeature
										});
	$.ajax({
		url:'data/420000.json',
		type:'get',
		dataType:'json',
		success:function(result){
			//console.log(result);
			hubeiprovince_geojson.addData(result);
		}
	});
	
	//武汉市geojson
	var WuhanCity_geojson = L.geoJSON(null,{
											onEachFeature: onEachFeature
										});
	$.ajax({
		url:'data/420100.json',
		type:'get',
		dataType:'json',
		success:function(result){
			//console.log(result);
			WuhanCity_geojson.addData(result);
		}
	});
	
	
	var WuChang_Style = {
	    "color": "#ff5500",
	    "weight": 2,
	    "opacity": 0.5
	};
	
	//武昌区geojson
	var Wuchang_geojson = L.geoJSON(null,{style:WuChang_Style,
											    onEachFeature: onEachFeature});
	$.ajax({
		url:'data/420106.json',
		type:'get',
		dataType:'json',
		success:function(result){
			//console.log(result);
			Wuchang_geojson.addData(result);
		}
	});
	
	var GDP_Polygon_Style = {
	    "color": "#ff5500",
	    "weight": 2,
	    "opacity": 0.5
	};
	
	//GDP_Polygon_geojson
	var GDP_Polygon_geojson = L.geoJSON(null,{style:GDP_Polygon_Style,
											    onEachFeature: onEachFeature});
	$.ajax({
		url:'data/GDP_Polygon.json',
		type:'get',
		dataType:'json',
		success:function(result){
			//console.log(result);
			GDP_Polygon_geojson.addData(result);
		}
	});
	
	//加载Geoserver发布的一个在线服务
	var Search_Polygon_geojson = L.geoJSON(null,{style:WuChang_Style,
											    onEachFeature: onEachFeature});
	$.ajax({
		url:'data/Search_Polygon.json',
		type:'get',
		dataType:'json',
		success:function(result){
			console.log(result);
			Search_Polygon_geojson.addData(result);
		}
	});
	
	var wmsLayer = L.tileLayer.wms('http://ows.mundialis.de/services/service?', {
	    layers: 'TOPO-OSM-WMS'
	});
	
	
	//定义专题图层
	var overlayMaps = {
		"武昌区": Wuchang_geojson,
		"武汉市": WuhanCity_geojson,
		"湖北省": hubeiprovince_geojson,
		"Search_Polygon":Search_Polygon_geojson,
		"GDP_Polygon_geojson":GDP_Polygon_geojson,
		"TOPO-OSM-WMS":wmsLayer
	};
	
	var layerControl = L.control.layers(baseLayers,overlayMaps, {}, {
		position: 'topright',
		collapsed: true
	}).addTo(map);
	layerControl.addBaseLayer(satellite, "Satellite");
	layerControl.addBaseLayer(streets, "streets");
	layerControl.addBaseLayer(grayscale, "grayscale");
}

